<div id="files">
    <? echo $adminMenu->manage(); ?>
    <h2><?php __('Files administration');?> (<? echo $html->link(__('new file',true), array('action'=>'add')); ?>)</h2>
    <? echo $form -> create(array('action'=>'delete_files')); ?>
    <table cellpadding="3" cellspacing="1" width="100%">
        <tr>
            <td width="7%"></td>
            <td></td>
            <td width="10%"></td>
            <td width="10%"></td>
            <td width="10%"></td>
            <td width="10%"></td>
        </tr>
        <tr class="table_head">
            <td colspan="2" class="first-top">
                <? echo $pagination -> create(null,'files'); ?>
            </td>
            <td colspan="4" class="last-top">
                <? __('Sort by'); ?>: <?php echo $paginator->sort(__('Name',true),'file');?> <? echo $paginator->sort(__('Size',true),'size'); ?> <?php echo $paginator->sort(__('Downloaded',true),'downloaded');?>
            </td>
        </tr>
        <tr>
            <th><? __('Action'); ?></th>
            <th><? __('Name'); ?></th>
            <th><? __('Size'); ?></th>
            <th><? __('Type'); ?></th>
            <th><? __('Downloaded'); ?></th>
            <th><? __('Delete'); ?> <input Type="checkbox" onclick="checkAll(this,'DownloadDeleteFilesForm')"/></th>
        </tr>
        <?php
        $i = 0;
        foreach ($downloads as $file):
            $class = null;
            if ($i++ % 2 == 0) {
                $class = ' class="altrow"';
            }
            ?>
        <tr<?php echo $class;?>>
            <td>
                    <?php echo $html->link($html->image('Edit.png',array('alt'=>__('Edit', true))),array('action'=>'edit', $file['Download']['id']),array('title'=>__('Edit',true)),null,false); ?>
                    <? echo $html->link($html->image('eye.png',array('alt'=>__("Preview",true))),"/downloads/view/".$file['Download']['file'],array('title'=>__('Preview',true),"target"=>"new"),null,false); ?>
                    <?php echo $html->link($html->image('bin.png',array('alt'=>__('Delete', true))), array('action'=>'delete', $file['Download']['id']),array('title'=>__('Delete',true)), __('Delete item', true).' #' . $file['Download']['file'],false); ?>
            </td>
            <td>
                    <?php echo $html->link($file['Download']['file'],array('action'=>'edit',$file['Download']['id'])); ?>
            </td>
            <td>
                    <? echo $number->toReadableSize($file['Download']['size']); ?>
            </td>
            <td>
                    <? echo $file['Download']['type']; ?>
            </td>
            <td>
                    <? echo $file['Download']['downloaded']; ?>
            </td>
            <td  align="center">
                <input Type="checkbox" Name="data[DownloadsDelete][]" value="<? echo $file['Download']['id']; ?>"/>
            </td>
        </tr>
        <?php endforeach; ?>
        <tr class="table_head">
            <td colspan="2" class="first-bottom">
                <? echo $pagination -> create(null,'files'); ?>
            </td>
            <td colspan="4" class="last-bottom">
                <? __('Sort by'); ?>: <?php echo $paginator->sort(__('Name',true),'file');?> <? echo $paginator->sort(__('Size',true),'size'); ?> <?php echo $paginator->sort(__('Downloaded',true),'downloaded');?>
            </td>
        </tr>
    </table>
    <div style="float: right; margin: 1em;"><? echo $form->submit(__('Delete',true)); ?></div>
</form>
</div>